'''
Created on 2009-4-17

@author: Administrator
'''
import unittest
from com.carnation.common.util.test import testTools


class Test(unittest.TestCase):
    def testGet(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(1, 'Run For Test Query.get', \
'''
Query.folder
    MOIData
        setId    "Table1=8"
Query.model
    MOIModel
        setId    "Model=1"
    Map
        attrName1    1
        attrName2    "ddd"
        attrName3    true
        attrName4    2009-04-29 10:29:00
Query.name
    String    "aaa"
    Boolean    false
    Boolean    true
Query.go
Query.get
    int    0
    int    100
''', \
'''
List
    0
        MOIData
            getId    "Column1=1"
            getName    "col1"
    1
        MOIData
            getId    "Column1=2"
            getName    "col2"
    2
        MOIData
            getId    "Column1=3"
            getName    "col3"
'''
)
        print rsp_msg
        print '\nDone'
        test.quit()

    def testSize(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(1, 'Run For Test Query.size', \
'''
Query.folder
    MOIData
        setId    "Table1=8"
Query.model
    MOIModel
        setId    "Model=1"
    Map
        attrName1    1
        attrName2    "ddd"
        attrName3    true
        attrName4    2009-04-29 10:29:00
Query.name
    String    "aaa"
    Boolean    false
    Boolean    true
Query.go
Query.size
''', \
'''
3
'''
)
        print rsp_msg
        print '\nDone'
        test.quit()


if __name__ == "__main__":
    unittest.main()

